package cn.stephen.study.demoproject.service.impl;

import cn.stephen.study.demoproject.dao.dbtwo.StationEquipmentMapper;
import cn.stephen.study.demoproject.entity.StationEquipment;
import cn.stephen.study.demoproject.service.StationEquipentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class StationEquipmentServiceImpl implements StationEquipentService {

    @Autowired
    private StationEquipmentMapper stationEquipmentMapper;

    @Override
    public List<Map<String, String>> findAll(String stationCode, String JSCJ204A050, Integer equipmentType) {
        if (stationCode.equals("")) {
            stationCode = null;
        }
        if (JSCJ204A050.equals("")) {
            JSCJ204A050 = null;
        }
        List<Map<String, String>> all1 = stationEquipmentMapper.findAll1(stationCode, JSCJ204A050, String.valueOf(equipmentType));
        List<Map<String, String>> all =new ArrayList<>();
        if (equipmentType==214) {
            all= stationEquipmentMapper.findAll1(stationCode, JSCJ204A050, "214,888");
            all1.addAll(all);
        }
        return  all1;

    }
}
